<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSystemAttachmentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('system_attachments', function (Blueprint $table) {
            $table->id()->comment('附件管理表');
            $table->integer('user_id')->comment('上传用户id');
            $table->string('name',100)->comment('附件名称');
            $table->integer('category_id')->comment('分类ID0编辑器,比如1商品图片,2拼团图片,3砍价图片,4秒杀图片,5文章图片,6组合数据图');
            $table->string('hash')->comment('哈希值');
            $table->string('att_dir',200)->comment('附件路径');
            $table->string('satt_dir',200)->nullable()->comment('压缩图片路径');
            $table->char('size',30)->comment('附件大小');
            $table->char('type',30)->comment('附件类型');
            $table->string('upload_type',30)->comment('图片上传类型 local Kodo(七牛云) OSS COS');
            $table->string('module_type',30)->comment('图片上传模块类型 admin(后台上传 ) user(用户生成)');
            $table->string('original_name')->comment('原始文件名');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('system_attachments');
    }
}
